﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.View
{
	public delegate void CharmNotification(string charmName);

	public delegate bool ShowCharm(string charmName);

	/// <summary>
	/// This is the service that controls the creation of the settings pane and activates charms
	/// </summary>
	public interface ICharmService
	{
		/// <summary>
		/// Creates a new entry in the Settings Pane and invokes notification delegate upon user selection
		/// </summary>
		/// <param name="charmName">display string for charm</param>
		/// <param name="notification">charm callback</param>
		void RegisterCharmNotify(string charmName, CharmNotification notification);

		/// <summary>
		/// Creates a new entry in the SettingsPane and invokes notification delegate upon user selection
		/// </summary>
		/// <param name="charmName">display string for the charm</param>
		/// <param name="notification">callback delegate for when the user select the charm</param>
		/// <param name="showCharm">delegate allows you to enable and disable charm at the point when the SettingsPane is shown</param>
		void RegisterCharmNotify(string charmName, CharmNotification notification, ShowCharm showCharm);

		/// <summary>
		/// Removes the charm specified from the SettingsPabe
		/// </summary>
		/// <param name="charmName"></param>
		void UnRegisterCharmNotify(string charmName);

		/// <summary>
		/// Opens a new charm of the specified name
		/// </summary>
		/// <param name="charmName"></param>
		void OpenCharm(string charmName);

		/// <summary>
		/// Opens a new charm of the specified name
		/// </summary>
		/// <param name="charmName"></param>
		/// <param name="navigationParameter"></param>
		void OpenCharm(string charmName, object navigationParameter);

		/// <summary>
		/// Move back in the charm stack (if ther are no more in the stack then SettingsPane is opened)
		/// </summary>
		void Back();

		/// <summary>
		/// Close the open charm
		/// </summary>
		void CloseCharm();
	}
}